-- Insert into table user
IF ( OBJECT_ID('dbo.m_users_insert') IS NOT NULL ) 
   DROP PROCEDURE dbo.m_users_insert
GO

CREATE PROCEDURE [dbo].[m_users_insert] 
	@m_username varchar(50), 
	@m_password varchar(50),
	@m_role int
AS
BEGIN

	SET NOCOUNT ON;

	INSERT INTO [dbo].[m_users](m_username, m_password, m_role)
	VALUES (@m_username, @m_password, @m_role)
END
GO

-- insert into table language
IF ( OBJECT_ID('dbo.m_languages_insert') IS NOT NULL ) 
   DROP PROCEDURE dbo.m_languages_insert
GO

CREATE PROCEDURE [dbo].[m_languages_insert] 
	@m_name varchar(50)
AS
BEGIN

	SET NOCOUNT ON;

	INSERT INTO [dbo].[m_languages](m_name)
	VALUES (@m_name) 
END
GO

-- insert to table manageindict
IF ( OBJECT_ID('dbo.m_managerindict_insert') IS NOT NULL ) 
   DROP PROCEDURE dbo.m_managerindict_insert
GO

CREATE PROCEDURE [dbo].[m_managerindict_insert] 
	@m_userID int, 
	@m_dictID int,
	@m_role int
	
AS
BEGIN

	SET NOCOUNT ON;

	INSERT INTO [dbo].[m_managerindict](m_userID, m_dictID, m_role)
	VALUES (@m_userID, @m_dictID, @m_role)
END
GO

---- insert to table word

IF ( OBJECT_ID('dbo.m_word_insert') IS NOT NULL ) 
   DROP PROCEDURE dbo.m_word_insert
GO

CREATE PROCEDURE [dbo].[m_word_insert] 
	@m_word varchar(200), 
	@m_meaning text,
	@m_dictID int,
	@m_status int
	
AS
BEGIN

	SET NOCOUNT ON;

	INSERT INTO [dbo].[m_word](m_word, m_meaning, m_dictID, m_status)
	VALUES (@m_word, @m_meaning, @m_dictID, @m_status)
END
GO

-- insert to table m_dictionaries
IF ( OBJECT_ID('dbo.m_dictionaries_insert') IS NOT NULL ) 
   DROP PROCEDURE dbo.m_dictionaries_insert
GO

CREATE PROCEDURE [dbo].[m_dictionaries_insert] 
	@m_fromID int, 
	@m_toID int,
	@m_dicturl varchar(512)
	
AS
BEGIN

	SET NOCOUNT ON;

	INSERT INTO [dbo].[m_dictionaries](m_fromID, m_toID, m_dicturl)
	VALUES (@m_fromID, @m_toID, @m_dicturl)
END
GO

-- insert into table approve

IF ( OBJECT_ID('dbo.m_approve_insert') IS NOT NULL ) 
   DROP PROCEDURE dbo.m_approve_insert
GO

CREATE PROCEDURE [dbo].[m_approve_insert] 
	@m_wordID int,
	@m_userID int
	
AS
BEGIN

	SET NOCOUNT ON;

	INSERT INTO [dbo].[m_approve](m_wordID, m_userID)
	VALUES (@m_wordID, @m_userID)
END
GO
